package com.java.control.impl;


import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;

import com.java.control.AbstractAdminCommandController;
import com.java.control.search.ProductSearchCond;
import com.java.control.search.SearchStat;
import com.java.control.search.SupplierQuotationSearchCond;
import com.java.entity.Product;
import com.java.entity.SupplierQuotation;
import com.java.service.ProductService;
import com.java.service.SupplierQuotationService;


/**
 * 产品信息查询
 * @author wqf
 * Nov 27, 2011 3:36:30 PM
 */
public class ShowQuotationListController extends AbstractAdminCommandController {

	public ShowQuotationListController(){
		this.setCommandClass(SupplierQuotationSearchCond.class);
	}	
	
	protected ModelAndView executeRequest(HttpServletRequest request,HttpServletResponse response,Object command)
		throws Exception{
		String id = request.getParameter("qid");		
		SupplierQuotationSearchCond searchCond=(SupplierQuotationSearchCond)command;
		ModelAndView mav = new ModelAndView(this.view);
		searchCond.setPageSize(10L);
		SearchStat searchStat = this.supplierQuotationService.getSearchStat(SupplierQuotation.class, searchCond);
		List<SupplierQuotation> List = this.supplierQuotationService.search(SupplierQuotation.class,searchCond);
		mav.addObject("searchStat", searchStat);		
		mav.addObject("searchCond", searchCond);
		mav.addObject("supplierQuotationList", List);
		mav.addObject("quotationId", id);
		return mav;		
	}
		
	private String view;
	
	private SupplierQuotationService supplierQuotationService;
	
	public void setSupplierQuotationService(
			SupplierQuotationService supplierQuotationService) {
		this.supplierQuotationService = supplierQuotationService;
	}
	public void setView(String view) {
		this.view = view;
	}
	
}
